#ifndef MYTHREAD_H
#define MYTHREAD_H

#include <QThread>
#include <QVector>
#include <QtGlobal>
#include <QDebug>
class Generate : public QThread
{
    Q_OBJECT
public:
    explicit Generate(QThread *parent = nullptr);

    void recvNum(int num);

protected:
    void run() override;

signals:
    void sendArray(QVector<int> num);

private:
    int m_num;

};

class BubbleSort : public QThread
{
    Q_OBJECT
public:
    explicit BubbleSort(QThread *parent = nullptr);

    void recvArray(QVector<int> list);

protected:
    void run() override;

signals:
    void Finish_Array(QVector<int> num);

private:
    QVector<int> m_list;

};


class QuickSort : public QThread
{
    Q_OBJECT
public:
    explicit QuickSort(QThread *parent = nullptr);

    void recvArray(QVector<int> list);

protected:
    void run() override;
private:
    void quickSort(QVector<int> &list,int l ,int r);  //对list里起始位置l，结束位置r，进行排序

signals:
    void Finish_Array(QVector<int> num);

private:
    QVector<int> m_list;

};






#endif // MYTHREAD_H
